<template>
  <div class="hello">
    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="没有更多了"
      @load="onLoad"
    >
      <van-cell v-for="item in list" :key="item.id" :title="item.productName" />
    </van-list>
  </div>
</template>

<script>
  import axios from 'axios'
export default {
  name: 'HelloWorld',
  data () {
    return {
      list: [],
      loading: false,
      finished: false,
    }
  },
  methods:{
    findAll:function () {
      axios.get("http://localhost:8080/product/findAll?page=1&size=10").then(res=>{
        this.list=res.data.data;
      })
    }
  },
  mounted(){
    this.findAll();
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
